/*    */ package com.structure.share;
/*    */ 
/*    */ public class FlyweightPatternTest
/*    */ {
/*  5 */   private static final String[] colors = { "Red", "Green", "Blue", "White", "Black" };
/*    */ 
/*    */   public static void main(String[] args) {
/*  8 */     for (int i = 0; i < 20; i++) {
/*  9 */       Circle circle = 
/* 10 */         (Circle)ShapeFactory.getCircle(getRandomColor());
/* 11 */       circle.setX(getRandomX());
/* 12 */       circle.setY(getRandomY());
/* 13 */       circle.setRadius(100);
/* 14 */       circle.draw();
/*    */     }
/*    */   }
/*    */ 
/*    */   private static String getRandomColor()
/*    */   {
/* 21 */     return colors[((int)(Math.random() * colors.length))];
/*    */   }
/*    */   private static int getRandomX() {
/* 24 */     return (int)(Math.random() * 100.0D);
/*    */   }
/*    */   private static int getRandomY() {
/* 27 */     return (int)(Math.random() * 100.0D);
/*    */   }
/*    */ }

/* Location:           C:\Users\lenovo\Desktop\DesignMode.jar
 * Qualified Name:     com.structure.share.FlyweightPatternTest
 * JD-Core Version:    0.6.2
 */